# Contributor: Bart Ribbers <bribbers@disroot.org>
# Maintainer: team/kde <bribbers@disroot.org>

# The group tag is just to easily find this APKBUILD by some scripts for automation
# group=kde-plasma
pkgname=plasma-disks
pkgver=5.27.10
pkgrel=0
pkgdesc="Monitors S.M.A.R.T. capable devices for imminent failure"
# armhf blocked by qt5-qtdeclarative
arch="all !armhf"
url="https://kde.org/plasma-desktop/"
license="GPL-2.0-or-later"
depends="
	kirigami2
	smartmontools
	"
makedepends="
	extra-cmake-modules
	qt5-qtbase-dev
	kcoreaddons5-dev
	kdbusaddons5-dev
	knotifications5-dev
	ki18n5-dev
	solid5-dev
	kservice5-dev
	kio5-dev
	kauth5-dev
	kdeclarative5-dev
	samurai
	"
checkdepends="xvfb-run"

case "$pkgver" in
	*.90*) _rel=unstable;;
	*) _rel=stable;;
esac
_repo_url="https://invent.kde.org/plasma/plasma-disks.git"
source="https://download.kde.org/$_rel/plasma/$pkgver/plasma-disks-$pkgver.tar.xz"
subpackages="$pkgname-lang"

build() {
	cmake -B build -G Ninja \
		-DCMAKE_BUILD_TYPE=RelWithDebInfo \
		-DCMAKE_INSTALL_PREFIX=/usr \
		-DCMAKE_INSTALL_LIBDIR=lib
	cmake --build build
}

check() {
	xvfb-run ctest --test-dir build --output-on-failure
}

package() {
	DESTDIR="$pkgdir" cmake --install build
}

sha512sums="
8170a280667c933a37233ec936af3e4b6328e145a099adc973436649c8a74cdd1f355e5aba7c8a6c6c8c8ea30630d4747386f07227f7e1d5dada4e85f1522b79  plasma-disks-5.27.10.tar.xz
"
